const v = 0

function fn () {
  let a = v
  return function () {
    ++a
    console.log( 'a', a )
  }
}
setTimeout( () => {
  console.log( '1' )
}, 0 )
console.log( 'generate' )

let aa = fn()
aa()
aa()
aa()
aa()
